//
//	ZcoModelEngine.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelEngine.h"

NSString *const kZcoModelEngineName = @"name";
NSString *const kZcoModelEngineVersion = @"version";

@interface ZcoModelEngine ()
@end
@implementation ZcoModelEngine




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kZcoModelEngineName] isKindOfClass:[NSNull class]]){
		self.name = dictionary[kZcoModelEngineName];
	}	
	if(![dictionary[kZcoModelEngineVersion] isKindOfClass:[NSNull class]]){
		self.version = dictionary[kZcoModelEngineVersion];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.name != nil){
		dictionary[kZcoModelEngineName] = self.name;
	}
	if(self.version != nil){
		dictionary[kZcoModelEngineVersion] = self.version;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.name != nil){
		[aCoder encodeObject:self.name forKey:kZcoModelEngineName];
	}
	if(self.version != nil){
		[aCoder encodeObject:self.version forKey:kZcoModelEngineVersion];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.name = [aDecoder decodeObjectForKey:kZcoModelEngineName];
	self.version = [aDecoder decodeObjectForKey:kZcoModelEngineVersion];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelEngine *copy = [ZcoModelEngine new];

	copy.name = [self.name copy];
	copy.version = [self.version copy];

	return copy;
}
@end